import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/student",
  },
  {
    path: "/user",
    name: "user",
    component: () => import("../views/users/Index.vue"),
    children: [
      {
        path: "/student",
        name: "student",
        component: () => import("../views/users/student.vue"),
      },
      {
        path: "/teacher",
        name: "teacher",
        component: () => import("../views/users/teacher.vue"),
      },
      {
        path: "/helper",
        name: "helper",
        component: () => import("../views/users/helper.vue"),
      },
    ],
  },
  {
    path: "/teach",
    name: "teach",
    component: () => import("../views/teach/Index.vue"),
  },
];

const router = new VueRouter({
  routes,
});

export default router;
